#ifndef APPLICATION_H_INCLUDED
#define APPLICATION_H_INCLUDED

#include "core/engine.h"
#include "core/process.h"
#include <boost/shared_ptr.hpp>
#include <string>

using boost::shared_ptr;
using std::string;

namespace engine {

	using namespace engine::core;
	
	class Application : public Process {
		private:
			shared_ptr<Engine> m_Engine;
			
			string m_ApplicationName;
			
		public:
			Application()
			:Process() {
				m_Engine = shared_ptr<Engine> (new Engine());
				
				setParent(m_Engine->getKernel());
				
				m_ApplicationName = "Base Application";
			}
			
			virtual ~Application() {
				
			}
			
			shared_ptr<Engine> getEngine() {
				return m_Engine;
			}
			
			void setApplicationName(const string& name) {
				m_ApplicationName = name;
			}
			
			virtual bool startApplication(shared_ptr<Application> app) {
				m_Engine->initialize(false, m_ApplicationName);
				m_Engine->createRenderWindow(1024, 768, false, m_ApplicationName);	
				m_Engine->registerApplication(app);
				m_Engine->startEngine();
				
				
				return true;
			}
			
	};
}

#endif // APPLICATION_H_INCLUDED
